package com.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Hanzi..
 *
 * @author Lizhong
 * @date 2019/8/13
 */
public class Hanzi {
    static String s = "云南省曲靖市沾益区"+"云南曲靖市沾益区";

    public static void main(String[] args) {
        String regexp = "云南省|曲靖市|云南|曲靖";


        Pattern compile = Pattern.compile(regexp);
        Matcher matcher = compile.matcher(s);
        while (matcher.find()) {
            int i = matcher.groupCount();
            System.out.println(i + "=====find()======");
            for (int j = 0; j <= i; j++) {
                String group = matcher.group(j);
                System.out.println(group);
            }
        }
    }
}
